package com.pms.mapper;

import com.pms.pojo.BizAskLeave;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface BizAskLeaveMapper {

    List<BizAskLeave> getLeaveList(@Param("name") String name,
                                   @Param("leaveType") String leaveType,
                                   @Param("status") Integer status,
                                   @Param("beginTime") String beginTime,
                                   @Param("endTime") String endTime);


    // 统计总数
    int countByCondition(
            @Param("name") String name,
            @Param("leaveType") String leaveType,
            @Param("status") Integer status,
            @Param("beginTime") String beginTime,
            @Param("endTime") String endTime
    );

    // 根据ID查询
    BizAskLeave selectById(Long id);

    // 更新请假记录
    int updateById(BizAskLeave record);

    int insert(BizAskLeave leave);

    List<BizAskLeave> selectByUserId(Long userId);
}